//
//  NotificationExtension.swift
//  Lottery
//
//  Created by 薛永伟 on 2018/12/12.
//  Copyright © 2018年 薛永伟. All rights reserved.
//

import UIKit

/**
 这里建议在每个模块里设置通知的静态变量，例如：UIApplication.didBecomeActiveNotification
 如果想非侵入性的为模块加入通知名的属性，可以在这里struct这个模块名，再设置通知名
 */
extension NSNotification.Name {
    
    /// 用户相关
    struct User {}
    
    /// 远程推送的通知
    struct RemoteNotification {
        
    }
    
}

extension Notification.Name.RemoteNotification {
    
    /// 强制退出登录
    static let ForceLogout = NSNotification.Name(rawValue: "RemoteNotificationForceLogout")
    
}

extension Notification.Name.User{
    /// 退出登录
    static let logoutCompleted       = NSNotification.Name(rawValue: "logoutCompleted")
    /// 登录成功
    static let loginCompleted     = NSNotification.Name(rawValue: "loginCompleted")
    /// 注册成功
    static let registerCompleted     = NSNotification.Name(rawValue: "registerCompleted")
    
    /// 用户信息有误，需要重新登陆
    static let UserInfoError     = NSNotification.Name(rawValue: "UserUserInfoError")
}

